﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Explorer.aspx.cs" Inherits="Marbles.Web.Admin.Explorer" %>
<%@ Register TagPrefix="cms"  Namespace="Marbles.Core.Controls" Assembly="Marbles.Core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head id="Head1" runat="server">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <title>Administration Console - File Explorer</title>
    <link href="/App_Themes/Admin/Site.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="titlebar" style="height:16px;border:solid 1px silver;background: blue;color:White; vertical-align:middle;font-weight:bold;padding:2px;">    
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td align="left"><div style="width:100%;overflow:hidden;white-space:nowrap;">&nbsp;File Explorer - <asp:Label ID="cLblPath" runat="server" ></asp:Label></div></td><td align="right">
    <a href="/Admin/"><img src="/Admin/Images/Home.png" width="16px" height="16px" alt="Home" border="0" /></a>
    &nbsp;
    <asp:ImageButton ID="cBtnNewFolder" runat="server" ToolTip="New Folder" CommandName="NewFolder" ImageUrl="/Admin/Images/folder-new.png" Width="16px" Height="16px" OnCommand="Page_Command" />
    <asp:ImageButton ID="cBtnDeleteFolder" runat="server" ToolTip="Delete Folder" CommandName="DeleteFolder" ImageUrl="/Admin/Images/edit-delete.png" OnClientClick="return confirm('Are you sure you wish To Delete the Current Folder?');" Width="16px" Height="16px" OnCommand="Page_Command" />
    &nbsp;
    <asp:ImageButton ID="cBtnBackup" runat="server" ToolTip="Download Directory Contents" CommandName="Download" ImageUrl="/Admin/Images/edit-save.png" Width="16px" Height="16px" OnCommand="Page_Command" />
    <asp:ImageButton ID="cBtnUpload" runat="server" ToolTip="Upload" CommandName="Upload" ImageUrl="/Admin/Images/download.png" Width="16px" Height="16px" OnCommand="Page_Command" />
    &nbsp;
    </td></tr></table>    
    </div>
    <div id="Container">
    <table border="1" cellpadding="0" cellspacing="0" style="width:100%;height:100%; vertical-align:top;">
    <tr><td style="width:200px;height:100%; vertical-align:top;">    
        <div style="height:100%;width: 100%;border:solid 1px silver;overflow:scroll;">
            <asp:TreeView ID="cViewDirs" runat="server" ShowLines="true" OnTreeNodeExpanded="cViewDirs_NodeExpand" OnSelectedNodeChanged="cViewDirs_NodeSelected" >
            </asp:TreeView>
        </div></td><td style="height:100%; vertical-align:top;">          
        <div style="height:100%;width: 100%;border:solid 1px silver;overflow:scroll;">
        <asp:DataList ID="cTblFiles" runat="server" OnItemDataBound="cTblFiles_ItemDataBound" >
        <ItemTemplate>
        <asp:Panel ID="cPnl" runat="server">
        <asp:ImageButton ID="cImgIcon" runat="server" width="32px" Height="32px" ImageAlign="AbsMiddle" />
        <asp:LinkButton  ID="cLnkName" runat="server" ></asp:LinkButton>
        </asp:Panel>
        </ItemTemplate>
        </asp:DataList>
        </div>
        </td></tr></table>
    </div>
    <script language="javascript" type="text/javascript">
        $("#Container").width($(window).width() - 10);
        $("#titlebar").width($(window).width() - 10);
            $("#Container").height($(window).height() - 35);
            window.onresize = function () { $("#Container").width($(window).width() - 10); $("#Container").height($(window).height() - 35); $("#titlebar").width($(window).width() - 10); }
    </script>


    <cms:ModalPopup ID="cDlgFileInfo" runat="server" Width="500px" Height="300px" Title="File Properties" Visible="false" >
    
    <table border="0" cellpadding="2" cellspacing="0">
    <tr><td><b>Name:</b></td><td><asp:Label ID="cLblName" runat="server" /></td></tr>
    <tr><td><b>Location:</b></td><td><asp:Label ID="cLblLoc" runat="server" /></td></tr>
    <tr><td><b>Size:</b></td><td><asp:Label ID="cLblSize" runat="server" /> (<asp:Label ID="cLblMBSize" runat="server" />)</td></tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <tr><td><b>Created</b></td><td><asp:Label ID="cLblCreated" runat="server" /></td></tr>
    <tr><td><b>Last Accessed</b></td><td><asp:Label ID="cLblLastAccess" runat="server" /></td></tr>
    <tr><td><b>Last Written</b></td><td><asp:Label ID="cLblLastWritten" runat="server" /></td></tr>
    <tr><td><b>Readonly</b></td><td><asp:checkbox ID="cChkReadonly" runat="server" Enabled="false"  /></td></tr>
    <tr><td><b>Attributes</b></td><td><asp:label ID="cLblAttributes" runat="server" /></td></tr>
    </table>
    <br />
    <center><asp:Button ID="cBtnInfoClose" runat="server" OnCommand="Page_Command" CommandName="InfoClose" Text="Close" />
    &nbsp;
    <asp:Button ID="cBtnInfoDelete" runat="server" OnCommand="Page_Command" CommandName="InfoDelete" OnClientClick="return confirm('Are you sure you wish to Delete this file?');" Text="Delete" />
    <asp:Button ID="cBtnInfoView" runat="server" OnCommand="Page_Command" CommandName="InfoView" Text="View" />
    </center>
    </cms:ModalPopup>


    <cms:ModalPopup ID="cDlgNewFolder" runat="server" Width="400px" Height="140px" Title="Create Folder" Visible="false" >
<table border="0" cellpadding="2" cellspacing="0">
<tr><td>Parent Folder:</td><td>&nbsp;</td><td><asp:Label ID="cLblnewFolderParent" runat="server" /></td></tr>
<tr><td>Name:</td><td>&nbsp;</td><td><asp:TextBox ID="cTxtNewFolderName" runat="server" MaxLength="255" Width="200px" ></asp:TextBox></td></tr>
</table>
<br /><br />
<center><asp:Button ID="cBtnNewFolderCreate" runat="server" Text="Save" OnCommand="Page_Command" CommandName="NewFolderCreate" />&nbsp;
<asp:Button id="cBtnNewFolderCancel" runat="server" Text="Cancel" OnCommand="Page_Command" CommandName="NewFolderCancel" />
    </center>
    </cms:ModalPopup>

    <cms:ModalPopup ID="cDlgFileUpload" runat="server" Width="400px" Height="140px" Title="Upload new File" Visible="false" >
<table border="0" cellpadding="2" cellspacing="0">
<tr><td>Destination:</td><td>&nbsp;</td><td><asp:Label ID="cLblFileUploadDest" runat="server" /></td></tr>
<tr><td>Filename:</td><td>&nbsp;</td><td><asp:FileUpload ID="cFileUpload" runat="server" /></td></tr>
</table>
<br /><br />
<center><asp:Button ID="cBtnSave" runat="server" Text="Save" OnCommand="Page_Command" CommandName="UploadCreate" />&nbsp;
<asp:Button id="cBtnCancel" runat="server" Text="Cancel" OnCommand="Page_Command" CommandName="UploadCancel" />
</center>
</cms:ModalPopup>

    <asp:HiddenField ID="cCurrentDir" runat="server" />
    </form>
</body>
</html>
